package com.zynote.nfhoujie.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Table;

/**
 * 
 * @className:Commodity.java
 * @classDescription: 商品内容
 * @author: AIDAN SU
 * @createTime: 2012-9-28
 *
 */

@Entity
@Table(name = "t_commodity", catalog = "nfhoujie")
public class Commodity implements java.io.Serializable {
	
	// 字段
	
	private static final long serialVersionUID = 28605522496109073L;

	/** 商品ID */
	private Long spid;
	
	/** 商品标题 */
	private String commodityTitle;
	
	/** 商品名称 */
	private String commodityName;
	
	/** 商品价格 */
	private Float commodityPrice;
	
	/** 商品介绍 */
	private String commodityExplain;
	
	/** 商品子类别 */
	private Integer childCategory;
	
	/** 商品父类别 */
	private Integer parentCategory;
	
	/** 商品图片 */
	private String commodityURL;
	
	/** 商品新旧程度 */
	private String commodityCondition;
	
	/** 用户ID */
	private Long uid;
	
	/** 商品发布时间 */
	private Date writeTime;
	
	/** 商品评论数 */
	private Long commentCount;
	
	/** 联系人 */
	private String contactPeople;
	
	private String contactType;
	/** 联系方式 */
	
	/** 联系地址 */
	private String contactAddress;
	
	/** 商品状态 */
	private Integer commodityStatus;

	// 构造方法

	/** 默认构造方法 */
	public Commodity() {
	}

	/** 完整的构造方法 */
	public Commodity( String commodityTitle, String commodityName, Float commodityPrice, String commodityExplain, Integer childCategory, 
			Integer parentCategory, String commodityURL,String commodityCondition, Long uid, Date writeTime, Long commentCount, String contactPeople,
			String contactType, String contactAddress,Integer commodityStatus) {
		this.commodityTitle = commodityTitle;
		this.commodityName = commodityName;
		this.commodityPrice = commodityPrice;
		this.commodityExplain = commodityExplain;
		this.childCategory = childCategory;
		this.parentCategory = parentCategory;
		this.commodityURL = commodityURL;
		this.commodityCondition = commodityCondition;
		this.uid = uid;
		this.writeTime = writeTime;
		this.commentCount = commentCount;
		this.contactPeople = contactPeople;
		this.contactType = contactType;
		this.contactAddress = contactAddress;
		this.commodityStatus = commodityStatus;
		
	}

	// 访问属性方法
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "spid", unique = true, nullable = false)
	public Long getSpid() {
		return this.spid;
	}
	public void setSpid(Long spid) {
		this.spid = spid;
	}
	
	@Column(name = "commodity_title", length = 50 )
	public String getCommodityTitle() {
		return this.commodityTitle;
	}
	public void setCommodityTitle(String commodityTitle) {
		this.commodityTitle = commodityTitle;
	}

	@Column(name = "commodity_name", length = 30)
	public String getCommodityName() {
		return this.commodityName;
	}
	public void setCommodityName(String commodityName) {
		this.commodityName = commodityName;
	}
		
	@Column(name = "commodity_price", precision = 20, scale = 0)
	public Float getCommodityPrice() {
		return commodityPrice;
	}
	public void setCommodityPrice(Float commodityPrice) {
		this.commodityPrice = commodityPrice;
	}
	
	@Column(name = "commodity_Explain", length = 20 )
	public String getCommodityExplain() {
		return commodityExplain;
	}
	public void setCommodityExplain(String commodityExplain) {
		this.commodityExplain = commodityExplain;
	}

	@Column(name = "child_category", precision = 20, scale = 0)
	public Integer getChildCategory() {
		return childCategory;
	}
	public void setChildCategory(Integer childCategory) {
		this.childCategory = childCategory;
	}
	
	@Column(name = "parent_category", precision = 20, scale = 0)
	public Integer getParentCategory() {
		return parentCategory;
	}
	public void setParentCategory(Integer parentCategory) {
		this.parentCategory = parentCategory;
	}

	@Column(name = "commodity_url", length = 256)
	public String getCommodityURL() {
		return commodityURL;
	}
	public void setCommodityURL(String commodityURL) {
		this.commodityURL = commodityURL;
	}
	
	@Column(name = "commodity_condition", length = 20)
	public String getCommodityCondition() {
		return commodityCondition;
	}
	public void setCommodityCondition(String commodityCondition) {
		this.commodityCondition = commodityCondition;
	}

	@Column(name = "uid" , precision = 20, scale = 0)
	public Long getUid() {
		return uid;
	}
	public void setUid(Long uid) {
		this.uid = uid;
	}

	@Column(name = "write_time")
	public Date getWriteTime() {
		return writeTime;
	}
	public void setWriteTime(Date writeTime) {
		this.writeTime = writeTime;
	}

	@Column(name = "comment_count", precision = 20, scale = 0)
	public Long getCommentCount() {
		return commentCount;
	}
	public void setCommentCount(Long commentCount) {
		this.commentCount = commentCount;
	}
	
	@Column(name = "contact_people", length = 20)
	public String getContactPeople() {
		return contactPeople;
	}
	public void setContactPeople(String contactPeople) {
		this.contactPeople = contactPeople;
	}

	@Column(name = "contact_type", length = 30)
	public String getContactType() {
		return contactType;
	}
	public void setContactType(String contactType) {
		this.contactType = contactType;
	}
	
	@Column(name = "contact_address", length = 30)
	public String getContactAddress() {
		return contactAddress;
	}
	public void setContactAddress(String contactAddress) {
		this.contactAddress = contactAddress;
	}
	
	@Column(name = "commodity_status", precision = 20, scale = 0)
	public Integer getCommodityStatus() {
		return commodityStatus;
	}
	public void setCommodityStatus(Integer commodityStatus) {
		this.commodityStatus = commodityStatus;
	}

}

